<?php
  include "dbfunc.php";
  include_once 'functions.php';
  init_user();
  $dbconn=init_db();
  $sql="select id,title from goods where user_id=".$userid." AND id NOT IN(SELECT goods_id2 FROM transaction where status=1) AND status=1";
  $res=mysql_query($sql);
  if(!$res){
    echo mysql_error();
    exit;
  }
  if(mysql_num_rows($res)==0){
    echo "没有可用的物品";
    exit();
  }
  echo "<script>register_getlist_page();</script>";
  echo "<form action='' method='post'>";
  while($row=mysql_fetch_array($res)) {
    echo  $row["title"];
    echo "<input type='radio' name='goods_id' value='".$row["id"]."'>";
    echo "<br>";
  }
  echo "<input type='button' id='select_button' class='select_button' value='选择'/>";
  echo "</form>";
?>
